package org.benjamin.lending.service;

import java.math.BigDecimal;

import org.benjamin.lending.domain.entity.MemberInfo;
import org.benjamin.lending.domain.entity.MemberMoneyLog.Type;
import org.benjamin.lending.domain.entity.MemberStatus;
import org.benjamin.lending.domain.entity.TransactType;
import org.benjamin.lending.domain.entity.WithdrawalsLog;
import org.benjamin.lending.domain.form.MemberForm;
import org.benjamin.lending.domain.form.WithdrawForm;
import org.benjamin.lending.domain.form.WithdrawIndex;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

public interface MemberInfoService {

    Page<MemberInfo> findMemberPage(MemberForm memberForm, Pageable pageable);

    MemberInfo findMemberDetails(String username);

    MemberInfo findMemberDetails(Integer id);

    MemberStatus findMemberStatusObject(String username);
    
    /**
     * 提现申请
     * @param memberInfo
     * @param withdrawForm
     * @param serviceCharge
     * @return
     */
    WithdrawalsLog withdrawApply(MemberInfo memberInfo,WithdrawForm withdrawForm,BigDecimal serviceCharge);
    
    /**
     * 提现受理
     * @param id
     */
    void withdrawAccept(TransactType transactType,Integer id,String bankCode,String bankName);
    
    /**
     * 提现到账
     * @param id
     */
    void withdrawReceived(TransactType transactType,Integer id);
    
    void withdrawFail(Integer id,String message);

    void recordMoneyChange(Type type, BigDecimal affectMoney, MemberInfo memberInfo, TransactType transactType,
                           Object rel);

    Page<WithdrawalsLog> findWithdrawLogPage(WithdrawIndex withdrawForm, Pageable pageable);

	boolean checkRealName(String username);

}
